package hit.core;

/**
 * Represents a notification about some change in the tree structure of the HIT system.
 * */
public class TreeNotification {
	
	/**
	 * This enum represents the various notification types for a TreeNotification
	 * */
	public enum Type {
		NODE_REMOVED, NODE_ADDED, NODE_EDITED
	}
	
	private Type notificationType;
	private ProductContainer modifiedContainer;
	private ProductContainer originalContainer;
	
	public TreeNotification() {
		notificationType = Type.NODE_EDITED;
		modifiedContainer = null;
		originalContainer = null;
	}
	
	/**
	 * @return the TreeNotificiationType of this TreeNotification
	 * */
	public Type GetNotificationType() {
		return notificationType;
	}
	
	/**
	 * @param notificationType the new notification type of the TreeNotification
	 * */
	public void SetNotificationType(Type notificationType) {
		this.notificationType = notificationType;
	}
	
	/**
	 * @return the node modified in the data model
	 * */
	public ProductContainer GetModifiedContainer() {
		return modifiedContainer;
	}
	
	/**
	 * @param modifiedContainer the new ProductContainer that was modified
	 * */
	public void SetModifiedContainer(ProductContainer modifiedContainer) {
		this.modifiedContainer = modifiedContainer;
	}
	
	/**
	 * @return the node before being modified in the data model
	 * */
	public ProductContainer GetOriginalContainer() {
		return originalContainer;
	}
	
	/**
	 * @param originalContainer the old ProductContainer that was modified
	 * */
	public void SetOriginalContainer(ProductContainer originalContainer) {
		this.originalContainer = originalContainer;
	}
}
